UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qceHsvr7xaG2Jt3Sl8NQh/Fw3myTYy10w6NC53uD5mE='
WHERE
key_id = 'ae37df86e97fe3803277c28a31dff97e88f850850fc5a3591fbffadd5fa72a3a'
AND (
token = 'qceHsvr7xaG2Jt3Sl8NQh/Fw3myTYy10w6NC53uD5mE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)