UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yftLe9dMTd31b0eDCHjC+XxB+bcA+FAHQLwvGNkTN/o='
WHERE
key_id = 'ffed0cefb48fbd58a099a6d438c88cedd1d5acd6dc0ba820812e62dbe4e345ba'
AND (
token = 'yftLe9dMTd31b0eDCHjC+XxB+bcA+FAHQLwvGNkTN/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)