UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZWN/PsVcB1ucU9Iu8n1T4Lkt2Gqh1BvctfRqr/YSOFQ='
WHERE
key_id = '1985fe239b1b8ea3f6cc6a9f85d97697cc1f0281e3e7691c7c249c31f2346f3e'
AND (
token = 'ZWN/PsVcB1ucU9Iu8n1T4Lkt2Gqh1BvctfRqr/YSOFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)