UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Px6k9DFcmeZXh+gfRMNGzN19FpCDEgbwH1bGGlr2sU0='
WHERE
key_id = '21a2bc0eb136718e72e3dbc7e49a41eab7b3795040a3afad715c35eb1f30e51f'
AND (
token = 'Px6k9DFcmeZXh+gfRMNGzN19FpCDEgbwH1bGGlr2sU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)