UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dr4z23vSDRA1Tvu88AGyi5g99qvF6k8gBp6t8CuNJQA=' 
WHERE 
  key_id = 'cf6c2ef2b643dd7807a056dafc1f3bece0ef876413fe1b6e25fe7cda88a0d9e5' 
  AND (
    token = 'Dr4z23vSDRA1Tvu88AGyi5g99qvF6k8gBp6t8CuNJQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039