UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jJtV0+nSdvROlh+vH1lrybyiMLrkiotsAdUtrgrGKz0='
WHERE
key_id = '6c7bf10c929eaf6c3546f389b63e625e6ac81e1adf12c1b9cc474ea01609e322'
AND (
token = 'jJtV0+nSdvROlh+vH1lrybyiMLrkiotsAdUtrgrGKz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)