UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CqqmPYfWzOxaCxgrY4jYFSY/QUeLc+laQINb+pYiWU4='
WHERE
key_id = 'ac3eee5357bcbf3be12090bb2ddb9e6a79635116c86e875bfc5fc7220ae3250e'
AND (
token = 'CqqmPYfWzOxaCxgrY4jYFSY/QUeLc+laQINb+pYiWU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)