UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SN3qnotIhFpUMU+6adVS1mtfSMr9XjHp0l2KM5KWBtA='
WHERE
key_id = '93c242d1598f3129f2f4750823df96661a73e4f5b7b601635083fe3ddcc85eca'
AND (
token = 'SN3qnotIhFpUMU+6adVS1mtfSMr9XjHp0l2KM5KWBtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)