UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cs/M25EG4O9eA9ckUujPn8yKZ+M3qSzyAqHgAxU2Nx0='
WHERE
key_id = 'b6961abe57c64fba396cf91afc8984964d0bdc3a8eab59ebe9439d32798ad70f'
AND (
token = 'cs/M25EG4O9eA9ckUujPn8yKZ+M3qSzyAqHgAxU2Nx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)