UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '11IGtHLm0GxS8R/fx9BCytM64SNVCYnhAArOuuaftJg=' 
WHERE 
  key_id = '892451b99ac1fb0224560451f33d38d3cc1642fc8f6d25df5bc787a782bebe21' 
  AND (
    token = '11IGtHLm0GxS8R/fx9BCytM64SNVCYnhAArOuuaftJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031