UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8QrC12EdK/zNb5FoPHTxoAQ/KWWa39NiIlaQflUksUA='
WHERE
key_id = '52438f09c8f91d2b39c44544804a4c823d3f3ceea2f20805a0167c6c7cbc9cbf'
AND (
token = '8QrC12EdK/zNb5FoPHTxoAQ/KWWa39NiIlaQflUksUA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)