UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4gpTWMA2n/AH/XKeXoIAuLNtVdVlT0LN7AABPUlPP04='
WHERE
key_id = 'ad88ac107500c568f865e841a467f41193950409658589f6db87a8d30cac6be1'
AND (
token = '4gpTWMA2n/AH/XKeXoIAuLNtVdVlT0LN7AABPUlPP04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)