UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Akp+EaUNEuSUs/l/4IUl1gG/77VSS16bxIlCPpeUnY='
WHERE
key_id = '896714ce83c20838c0e51a83ffe9eb82698499129bad56f70a0a9fdacfe2151d'
AND (
token = '/Akp+EaUNEuSUs/l/4IUl1gG/77VSS16bxIlCPpeUnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)