UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PzWpnvZuuVcMPtTZB3wfE5f59wKV3PITP+NYf2zViys='
WHERE
key_id = 'e673d121b32e27ac754c93b0bf77ec211b3268a68e81b539cb3a6d7e8c827d24'
AND (
token = 'PzWpnvZuuVcMPtTZB3wfE5f59wKV3PITP+NYf2zViys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)