UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BPC0EoP/S/W6fNOAILSMGoy9CQAbApSjLxbw//j8Los='
WHERE
key_id = '71fd7d0c810ad0259d245a6d3d2e0fe453dd11f3e4b6bd7855854c5ca6c517cd'
AND (
token = 'BPC0EoP/S/W6fNOAILSMGoy9CQAbApSjLxbw//j8Los='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)