UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KrX8sswvD2RC1co3kXIBtVlGSgwHo++ghPwBoohQdVM='
WHERE
key_id = '93a1554aa5f5d440badeb934c1422a4e892fcdbd06bcb45f04ef34fed1a8cfd0'
AND (
token = 'KrX8sswvD2RC1co3kXIBtVlGSgwHo++ghPwBoohQdVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)