UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4u42lMkv0Yd0Ypar/zl2orneo0Tk6KxLBbqFeJJTOY='
WHERE
key_id = '4d74f387a0f06f4b066cdd5c785f21d22ebd82801f3719191d5ef5ae0f006452'
AND (
token = 's4u42lMkv0Yd0Ypar/zl2orneo0Tk6KxLBbqFeJJTOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)