UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r+qk5gjIB9rwfJEpIErf6oLVll99jKn4IXlY3xyGGoc='
WHERE
key_id = '70af7cdebf58270f75dad4e9fe0fb0cea23eb55c5101d9bcc98c3739deeb3f74'
AND (
token = 'r+qk5gjIB9rwfJEpIErf6oLVll99jKn4IXlY3xyGGoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)