UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rvQ2OTuuQSfbAMPZ0CbDs4y9m7iKMl1FZj8pvts6z6w='
WHERE
key_id = 'e08ad0a3a7afcd2d8a497c22f5d3bdadbefe8982582da33ce97dd207e39634d0'
AND (
token = 'rvQ2OTuuQSfbAMPZ0CbDs4y9m7iKMl1FZj8pvts6z6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)