UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hoM+QBwXZr2YgimtiAZJXAX6KkxUrce/KRl5WW1wdC4='
WHERE
key_id = '2f1fee2f1918894c8c44eb4195871e338574db265504776fa62fe88a15173971'
AND (
token = 'hoM+QBwXZr2YgimtiAZJXAX6KkxUrce/KRl5WW1wdC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)