UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'auZf7XIWB93gNdx92EcnI6Vjd1/xisFMgptwyf43LP8='
WHERE
key_id = '18ad1d87ca2229bcb72f7274342956a6989bcedd15b6ff91b066e8ad23cb4f5c'
AND (
token = 'auZf7XIWB93gNdx92EcnI6Vjd1/xisFMgptwyf43LP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)