UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IPN7pjnObvDBw1pcbrkTs4Z7pTrCw4wGlaz1YuDfXfc=' 
WHERE 
  key_id = '0421960651840049794677149c4db6b62c3d3bb4342c3bb9e2fca2776e50f3b2' 
  AND (
    token = 'IPN7pjnObvDBw1pcbrkTs4Z7pTrCw4wGlaz1YuDfXfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027