UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6LiBjPjOy7aMAWvk/cNzkHbh6NkM1MzlfwCvZZKIvOI='
WHERE
key_id = 'f8554129f78ef1cd5d3f45c7ea21d6f23a68aea1b9e526a435059eee65dd7270'
AND (
token = '6LiBjPjOy7aMAWvk/cNzkHbh6NkM1MzlfwCvZZKIvOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)