UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KeeLrY1gr2nz6wKFZqI+kseiBHdYmrUniS6Uc1oW4No='
WHERE
key_id = '6fe9dcb389018ea125650919fbf85b6362f773dda04e46a38aeb6eb50263195a'
AND (
token = 'KeeLrY1gr2nz6wKFZqI+kseiBHdYmrUniS6Uc1oW4No='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)