UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tCXPJ+j3Tk46TlxA69Ln/TxUEteUUUqowhpRH6oZcuU=' 
WHERE 
  key_id = '46b0f8cfcca889f22dd9271f27aa884034c3f69ee95f7eeb0f412454a2bd64a8' 
  AND (
    token = 'tCXPJ+j3Tk46TlxA69Ln/TxUEteUUUqowhpRH6oZcuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021