UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cJw1tx66KHw2zIj9xXH2xVgM2qaDXOXJe8as9XgzEvI=' 
WHERE 
  key_id = '90c86ef8b6780b8d5bb0281ce0c36b46e3bd0be23ad622791a85939ec7a666da' 
  AND (
    token = 'cJw1tx66KHw2zIj9xXH2xVgM2qaDXOXJe8as9XgzEvI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032