UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8+/LW7C/aNqcJoypmhtwJuuP6qYNMDPBJH2Tn2OLKns='
WHERE
key_id = '9fe1c075ac7a86dfe9f8e1d21181970de6ce75b600379e9c4fa53d6b6a8760c7'
AND (
token = '8+/LW7C/aNqcJoypmhtwJuuP6qYNMDPBJH2Tn2OLKns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)