UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5gWaxyCSujC8pL2tNg+gGlkVgseiuR65X1I8b+l/cGQ='
WHERE
key_id = 'e9a61b0aab1b72be9110bbc7ea5ee943373d7a31023c207f0f4678d2b3b5f9f3'
AND (
token = '5gWaxyCSujC8pL2tNg+gGlkVgseiuR65X1I8b+l/cGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)