UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ym7hfM1ZOKkyQuGelgOqB1bLMfd+QahxDLZKlG0DzJg=' 
WHERE 
  key_id = '1cc0e06ca8806eb9f1d975f7c02980b4616e390a48effae8b56198e49c87990e' 
  AND (
    token = 'Ym7hfM1ZOKkyQuGelgOqB1bLMfd+QahxDLZKlG0DzJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018