UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Z7uwpHqIh1agc1K9LQLD3yVi3Gg3cneCBhEya5uLxE='
WHERE
key_id = '06707bd6ca416f9606bf953fd198d1f037109013fc5d8a148d1e75169b9d4cb0'
AND (
token = '6Z7uwpHqIh1agc1K9LQLD3yVi3Gg3cneCBhEya5uLxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)