UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RzVT5Gego8J0v7BXVr+1qJydyE6Tabu8dDqlDBLW4Dc='
WHERE
key_id = '0605e8bd8f134c3b32ced3dec68ebc4d1cb0de717ac0c063933afedacc837aaf'
AND (
token = 'RzVT5Gego8J0v7BXVr+1qJydyE6Tabu8dDqlDBLW4Dc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)