UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ig9DbiBUkKdqTy03h/MCMLZRdMXnsyqbxk/wvanaJ+I=' 
WHERE 
  key_id = '02a550a9c70ac57d809dc96d0cdff4d020d6aa4a89f5514c390196544e79dde4' 
  AND (
    token = 'Ig9DbiBUkKdqTy03h/MCMLZRdMXnsyqbxk/wvanaJ+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029