UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cLVTZhRuPCLqiHNOQOCSrU/+hDZtvLCiHt5oLpMfbn0='
WHERE
key_id = 'f4e123a209d6a504ee6c986eff4c1b5599084d5e632b37fd16c1e376a1032669'
AND (
token = 'cLVTZhRuPCLqiHNOQOCSrU/+hDZtvLCiHt5oLpMfbn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)