UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LPt7sVhiyxr/d80E7M6oWTYKaGE9yFsogg05vFLTUSY=' 
WHERE 
  key_id = 'acafb28f51d2d102cf793d700c7beb86648218b8debc6775a1c669e74a7a410c' 
  AND (
    token = 'LPt7sVhiyxr/d80E7M6oWTYKaGE9yFsogg05vFLTUSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042