UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '730AsQmnfEeVw8NpOV+b5EW58JshW/CkKQ/QvBh2SNU='
WHERE
key_id = '7cbf01de34f2fac0ab05b672ffed5decbad67e89815f2b4550c0f5e667f361f8'
AND (
token = '730AsQmnfEeVw8NpOV+b5EW58JshW/CkKQ/QvBh2SNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)