UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NzQC4nb78W3YLrQOfAdPwq2u+nkRNHPdFF9dm0oaAuk='
WHERE
key_id = 'b26e192545471347c4ece9b2cd62278c7b3c5c64c47285dd5c3a88d9a7df3edb'
AND (
token = 'NzQC4nb78W3YLrQOfAdPwq2u+nkRNHPdFF9dm0oaAuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)