UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9DSYpFWcF0dOqlzyXCRiuUJ/8xY1jIvnRpcWVD7KBag='
WHERE
key_id = '0b4d3de913311fbcf705a2007f1d44cbe6a2d8233b6ab85db2fd93e918032e64'
AND (
token = '9DSYpFWcF0dOqlzyXCRiuUJ/8xY1jIvnRpcWVD7KBag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)