UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y/heIp5uZjLFaijRzbaaocbvP3gkV6MRSa4kSkZiQnc='
WHERE
key_id = '81f423c03827388fa8206142a452e230ee0015930a179ab7dd09598cbfa9ac23'
AND (
token = 'Y/heIp5uZjLFaijRzbaaocbvP3gkV6MRSa4kSkZiQnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)