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

Query time 0.00033